home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / COMPILER / SATHER / !Sather / Library / Strings / Str.sam < prev   
Text File  |  1997-03-08  |  2KB  |  67 lines

  1. -- Copyright (C) International Computer Science Institute, 1994.  COPYRIGHT  --
  2. -- NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY and is subject --
  3. -- to the terms of the SATHER LIBRARY GENERAL PUBLIC LICENSE contained in    --
  4. -- the file "Doc/License" of the Sather distribution.  The license is also   --
  5. -- available from ICSI, 1947 Center St., Suite 600, Berkeley CA 94704, USA.  --
  6. --------> Please email comments to "sather-bugs@icsi.berkeley.edu". <----------
  7.  
  8. (*
  9.  
  10. STRING CLASSES
  11.  
  12. The central workhorse of string manipulation is STR.  Sather
  13. provides a literal syntax for STR:
  14.  
  15.     "abc"
  16.  
  17. All STR objects are immutable, so they have a convenient value
  18. semantics.  They are stored as a contiguous character array with
  19. a size field.
  20.  
  21. Sometimes it is much more efficient to operate on strings in
  22. place.  FSTR is a non-immutable string type, extended by amortised
  23. doubling.  It can do most of the things that STR can, but has the
  24. uglier property that you need writebacks:
  25.  
  26.     fstr := fstr + "abc";
  27.  
  28. Here, the 'fstr' returned may be the same as the 'fstr' on the right
  29. side; in fact is usually will be.  Novices are encouraged to use
  30. STR if speed is not an issue.
  31.  
  32. STR_CURSOR provides a way of parsing strings into pieces in the
  33. same way that scanf() allows in C.
  34.  
  35. GLOB is an attempt at a csh-like globbing facility.  In the future
  36. there will be other classes for generalized searching.
  37.  
  38. REGEXP contains an interface to the POSIX regular expression interface.
  39. Is a replacement for GLOB, but might not work on all platforms, as it
  40. relies on the proper C implementation of the POSIX standard.
  41.  
  42. *)
  43.  
  44. -- This is a list of library files that can automatically
  45. -- be loaded by a reference in users' SATHER_COMMANDS env variable
  46.  
  47.     fstr.sa -has fstr.sa FSTR 
  48.     glob.sa -has glob.sa GLOB
  49.     str.sa -has str.sa STR C_STR
  50.     str_cursor.sa -has str_cursor.sa STR_CURSOR 
  51.     test/str_cursor.sa -has test/str_cursor.sa TEST_STR_CURSOR    
  52.     test/fstr.sa -has test/fstr.sa TEST_FSTR
  53.  
  54.     test/format.sa -has test/format.sa TEST_FMT
  55.     format.sa -has format.sa $FMT FMT FMT_ERROR_FLAGS FMT_ERROR
  56.     base_fmt.sa -has base_fmt.sa $FLT BASE_FORMAT FMT_NUMBERS
  57.  
  58.     regexp.sa -has regexp.sa REGEXP TEST_REGEXP C_REGEXP
  59.  
  60. -- regexp.c needs some of the Sather header files, so make the system
  61. -- directory abailable.
  62.  
  63.     -external C_REGEXP -C_flag -I$(SATHER_HOME)/System/Common
  64.     -external C_REGEXP "$(SATHER_HOME)/Library/Strings/regexp.c "
  65.     -end
  66.  
  67.